import type { App } from 'vue'

export function buildInstall(components: any[]) {
  return function install(app: App) {
    components.forEach(comp => {
      if (typeof comp === 'function' || typeof comp.install === 'function') {
        app.use(comp)
      } else {
        app.component(comp.name, comp)
      }
    })
  }
}